//
//  FMDownLoadManager.h
//  FMDownLoad
//
//  Created by apple on 17/3/22.
//  Copyright © 2017年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDownLoader.h"

@interface FMDownLoadManager : NSObject

+ (instancetype) shareInstance;

/**
 *  下载
 *
 *  @param url url
 *
 *  @return 对应的下载器
 */
- (FMDownLoader *)downLoadWithURL: (NSURL *)url;

/**
 *  下载
 *
 *  @param url                   url
 *  @param downLoadInfoTypeBlock 下载信息回调
 *  @param successBlock          成功的回调
 *  @param failBlock             失败的回调
 */
- (void)downLoadedWithUrl:(NSURL *)url downLoadInfoTypeBlock:(DownLoadInfoTypeBlock)downLoadInfoTypeBlock successBlock:(DownLoadSuccessBlock)successBlock failBlock:(DownLoadFailTypeBlock)failBlock;

/**
 *  根据URL获取下载器
 *
 *  @param url url
 *
 *  @return 返回下载器
 */
- (FMDownLoader *)getCurrentDownLoaderWithURL:(NSURL *)url;

- (void)pauseWithURL:(NSURL *)url;

- (void)pauseAll;

- (void)resumeAll;

- (void)cancelWithURL:(NSURL *)url;

- (void)cancelAndCleanWithURL:(NSURL *)url;

@end
